﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;


public class EncryptHelper
{
    public static string Md5Encrypt(string data)
    {
        MD5CryptoServiceProvider md5Hasher = new MD5CryptoServiceProvider();
        byte[] dataHashed = md5Hasher.ComputeHash(Encoding.Default.GetBytes(data));
        StringBuilder sBuilder = new StringBuilder();
        for (int i = 0; i < dataHashed.Length; i++)
        {
            sBuilder.Append(dataHashed[i].ToString("x2"));
        }
        return sBuilder.ToString();
    }
}
